package com.zsyh.jiujiu.weight;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.ms.banner.holder.BannerViewHolder;
import com.zsyh.jiujiu.R;


/**
 * Created by liangwanbo
 */
public class CustomViewHolder implements BannerViewHolder<Object> {

    @Override
    public View createView(Context context, int position, Object data) {
        // 返回mImageView页面布局
        ImageView imageView = new ImageView(context);
        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT
        );
        imageView.setLayoutParams(params);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);

        Glide.with(context).load(data).placeholder(R.mipmap.ic_bai_back).into(imageView);

        return imageView;
    }

}
